{% extends 'base.jinja2' %}

{% set adb_serial_number = adb_serial_number|default("'0000000000'") %}
{% set fastboot_serial_number = fastboot_serial_number|default("'0000000000'") %}
{% set soft_reboot_command = soft_reboot_command|default('adb -s ' + fastboot_serial_number + ' reboot bootloader') %}
{% set device_info = device_info|default([{'board_id': fastboot_serial_number}]) %}

{% block body %}
adb_serial_number: "{{ adb_serial_number|default('0000000000') }}"
fastboot_serial_number: "{{ fastboot_serial_number|default('0000000000') }}"
fastboot_options: {{ fastboot_options|default([]) }}

{% if fastboot_deploy_uboot_commands %}
# This attribute identifies whether a device should get into fastboot mode by
# interrupting uboot and issuing commands at the bootloader prompt.
fastboot_via_uboot: True
{% endif %}

actions:
  deploy:
    methods:
      lxc:
      ssh:
        options:
{{ ssh_options }}
        host: '{{ ssh_host|default('') }}'
        port: {{ ssh_port|default(22) }}
        user: {{ ssh_user|default('root') }}
        identity_file: {{ ssh_identity_file }}
{% if recovery_mode %}
{{ recovery_mode }}
          recovery_mode:
{% for url in recovery_mode_command %}
          - {{ url }}
{% endfor %}
          recovery_exit:
{% for url in recovery_exit_command %}
          - {{ url }}
{% endfor %}
{% endif %}
      nfs:
      fastboot:
{% if fastboot_deploy_uboot_commands %}
      u-boot:
        parameters:
          bootloader_prompt: "{{ bootloader_prompt }}"
          interrupt_prompt: "{{ interrupt_prompt }}"
          interrupt_char: "{{ interrupt_char }}"
          fastboot:
            commands:
{% for command in fastboot_deploy_uboot_commands %}              - {{ command }}{% endfor %}
{% endif %}
{{- fastboot_interrupt_params }}
    connections:
      adb:
      fastboot:
      lxc:
      serial:
  boot:
    connections:
      adb:
      fastboot:
      lxc:
      serial:
      adb:
    methods:
      lxc:
      ssh:
      fastboot: {{ fastboot_sequence }}
{{- fastboot_boot_uboot }}
{{- fastboot_boot_grub }}
{% endblock body %}
